package com.zkthink.ceres.promotion.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.zkthink.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.zkthink.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 营销活动申请表
 * </p>
 *
 * @author JustArgo
 * @since 2020-06-27
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_promotion_apply_info")
@ApiModel(value = "PromotionApplyInfo", description = "营销活动申请表")
@AllArgsConstructor
public class PromotionApplyInfo extends Entity<Long> {

  private static final long serialVersionUID = 1L;

  /**
   * 营销活动id
   */
  @ApiModelProperty(value = "营销活动id")
  @NotNull(message = "营销活动id不能为空")
  @TableField("promotion_id")
  @Excel(name = "营销活动id")
  private Long promotionId;

  /**
   * 状态    1-待审核 2-审核通过 3-审核不通过
   */
  @ApiModelProperty(value = "状态 1-待审核 2-审核通过 3-审核不通过")
  @NotNull(message = "审核状态 不能为空")
  @TableField("status")
  @Excel(name = "状态 1-待审核 2-审核通过 3-审核不通过")
  private Integer status;

  /**
   * 付保证金时的订单id，不需要保证金则为空
   */
  @ApiModelProperty(value = "付保证金时的订单id，不需要保证金则为空")
  @NotEmpty(message = "付保证金时的订单id，不需要保证金则为空不能为空")
  @Length(max = 32, message = "付保证金时的订单id，不需要保证金则为空长度不能超过32")
  @TableField(value = "pay_deposit_order_id", condition = LIKE)
  @Excel(name = "付保证金时的订单id，不需要保证金则为空")
  private String payDepositOrderId;

  /**
   * 审核备注
   */
  @ApiModelProperty(value = "审核备注")
  @NotEmpty(message = "审核备注不能为空")
  @Length(max = 255, message = "审核备注长度不能超过255")
  @TableField(value = "audit_remark", condition = LIKE)
  @Excel(name = "审核备注")
  private String auditRemark;

  /**
   * 商品数组
   */
  @ApiModelProperty(value = "商品数组")
  @NotEmpty(message = "商品数组不能为空")
  @Length(max = 500, message = "商品数组长度不能超过500")
  @TableField(value = "product_ids", condition = LIKE)
  @Excel(name = "商品数组")
  private String productIds;

  /**
   * 是否删除0否 1是
   */
  @ApiModelProperty(value = "是否删除0否 1是")
  @NotNull(message = "是否删除0否 1是不能为空")
  @TableField("is_delete")
  @Excel(name = "是否删除0否 1是")
  private Integer isDelete;


    @ApiModelProperty(value = "审核次数")
    @NotNull(message = "审核次数")
    @TableField("audit_count")
    @Excel(name = "审核次数")
    private Integer auditCount;


    @Builder
    public PromotionApplyInfo(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser,
                    Long promotionId, Integer status, String productIds, Integer isDelete) {
        this.id = id;
        this.createTime = createTime;
        this.createUser = createUser;
        this.updateTime = updateTime;
        this.updateUser = updateUser;
        this.promotionId = promotionId;
        this.status = status;
        this.productIds = productIds;
        this.isDelete = isDelete;
    }

}
